import Vue from 'vue'
import VueRouter from 'vue-router'

//首页
// import index from 'pages/index/index'
/*页面路由*/
import index_r from 'pages/index/routes'
import home_r from 'pages/home/routes'
import module_r from 'pages/module/routes'
import detail_r from 'pages/detail/routes'
import order_r from 'pages/order/routes'
import reload_r from 'pages/reload/routes'
import scancode_r from 'pages/scancode/routes'
import yd_r from 'pages/yd/routes'
import scanbook_r from 'pages/scanbook/routes'
import readrecord_r from 'pages/readrecord/routes'
import page_r from 'pages/page/routes'
let routes = [
    { 
        path: '/', 
        name: '/',
        meta: {
            name: '首页'
        },
        component: () => import('pages/index/index.vue').then(e=>e.default)
    },
]

routes = routes.concat(
    index_r,
    home_r,
    module_r,
    detail_r,
    order_r,
    reload_r,
    scancode_r,
    yd_r,
    scanbook_r,
    readrecord_r,
    page_r,
)

//安装路由功能
Vue.use(VueRouter);
//创建 router 实例，然后传 `routes` 配置
export default new VueRouter({
    mode: 'history',
    routes // （缩写）相当于 routes: routes
});